package ganga.custodian.sensors;

import java.sql.Timestamp;
import java.util.LinkedList;

// LinkedList version
public class AccelerometerBuffer extends LinkedList<AccelerometerValuesBasket> {
	public AccelerometerBuffer(){
		addBasket();
	}
	public void Add(Timestamp timestamp, float[]values){
		if (!currentBasket.HasSpace())
			addBasket();

		currentBasket.Add(timestamp, values);
	}

	AccelerometerValuesBasket currentBasket;
	private void addBasket() {
		currentBasket = new AccelerometerValuesBasket();
		synchronized (this) {
			add(currentBasket);
		}
	}
}
